<?php

namespace app\mini\model;

use app\common\model\BaseModel;
use app\common\model\Store;
use app\company\model\CompanyOrder;
use think\model\relation\BelongsTo;

class RefundOrderInfo extends BaseModel
{
    protected $deleteTime = false;

    const STATUS_WAIT = 1; //待入库
    const STATUS_OK = 2; //已入库

    public function orderInfo()
    {
        return $this->hasOne(CompanyOrder::class, 'id', 'company_order_id');
    }

    public function orderDetail()
    {
        return $this->hasMany(RefundOrderDetail::class, 'ro_id', 'id');
    }

    public function store(): BelongsTo
    {
        return $this->belongsTo(Store::class,'store_id','id');
    }
}